import {defineStore} from "pinia";

const useBoardMenu = defineStore('useBoardMenu', {
  state: () => ({
    nowRouter: [],
    // {title: '', name: ''}
  }),
  // persist: {
  //   key: 'userInfo',
  //   storage: sessionStorage,
  // },
  getters: {
    getNavRouters(newState){
      if (newState.nowRouter.length === 0){
        newState.nowRouter = JSON.parse( sessionStorage.boardMenu );
      }
      return newState.nowRouter;
    }
  },
  actions: {
    getName(){
      console.log(this.name,'12')
      // console.log('11',111)
    }
  },
})

export default useBoardMenu